
#ifdef a 
#include<stdio.h>
#define MAXS 20

void zip(char* p);
int main()
{0

    char s[MAXS];
    scanf("%s", s);

    zip(s);
    printf("%s\n", s);

    return 0;
}

//字符串压缩
void zip(char* p) {
    char temp[20] = { 0 };
    int i, sz, count;
    char num;
    sz = i = 0;
    while (p[i]) {
        count = 1;
        while (p[i] &&  (p[i] == p[i + 1])) {
            count++;
            i++;
        }
        if (count > 1 && count <= 9) {
            num = count + '0';
            temp[sz++] = num;
        }
        else if (count > 9 && count <= 20) {
            temp[sz++] = count / 10 + '0';
            temp[sz++] = count % 10 + '0';
        }
        else {
            temp[sz++] = p[i];
            i++;
        }
    }
    int j;
    for (j = 0; j < sz; j++)
        p[j] = temp[j];
    p[j] = '\0';
}
#endif
